package com.laotou99.wmsjjj.wmsjjj.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.laotou99.wmsjjj.wmsjjj.bean.po.LOTPO;

public interface LOTPORepository 
	extends JpaRepository<LOTPO, Long> {

	
	public List<LOTPO> findBySku(String sku);
	 
	@Query(value="SELECT t.SKU,t.STORE_KEY,SUM(t.MOQ_NUM) AS NUM, "
			+ "o.SKUEN,o.SKUCN "
			+ "FROM LOTPO t,SKUPO o "
			+ "WHERE t.SKU = o.SKU_ID "
			+ "GROUP BY t.SKU,t.STORE_KEY,o.SKUEN,o.SKUCN", 
			nativeQuery = true)
	public List<Object[]> CountSku();
}
